import org.apache.hadoop.hbase.client.Mutation;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.mapreduce.TableReducer;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class YourReducer extends TableReducer<Text, Text, NullWritable> {
    @Override
    protected void reduce(Text key, Iterable<Text> values, Reducer<Text, Text, NullWritable, Mutation>.Context context) throws IOException, InterruptedException {
        String word = key.toString();
        StringBuilder builder = new StringBuilder();
        for (Text v : values) {
            builder.append(v.toString()).append(',');
        }
        Put put = new Put(word.getBytes());
        put.addColumn("info".getBytes(), "files".getBytes(), builder.substring(0, builder.length() - 1).getBytes());
        context.write(NullWritable.get(), put);
    }
}
